/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.unicauca.opentextbook.controladores;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *
 * @author ADM_JMARTINEZ
 */
@ManagedBean(name = "canalesController")
@ApplicationScoped
public class CanalesController implements Serializable {

    //LOG
    private static final Log LOG = LogFactory
            .getLog(LoginController.class.getName());
    //Canales
    private Map<String, String> channels;

    /**
     * Creates a new instance of CanalesController
     */
    public CanalesController() {
        channels = new HashMap<String, String>();
    }

    public void adicionarCanalParaLibro(String libro, String channel) {
        LOG.info("Dentro de adicionarCanalParaLibro: " + libro + " " + channel);
        channels.put(libro, channel);
    }

    public String obtnereCanalPorLibro(String libro) {
        LOG.info("Dentro de obtenerCanalPorLibro: " + channels.get(libro));
        return channels.get(libro);
    }
}
